import 'package:flutter/cupertino.dart';
import 'package:mall/constant/app_colors.dart';
import 'package:mall/utils/image_component/image_component.dart';

class InputWidget extends StatelessWidget {
  const InputWidget({
    super.key,
    this.leftIcon,
    required this.textField,
  });

  //左边小图标
  final String? leftIcon;

  final CupertinoTextField textField;

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 50,
      padding: EdgeInsets.only(left: 20, right: 20),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.all(Radius.circular(25)),
        color: AppColors.C_F8F8F8,
      ),
      child: Row(
        children: [
          ImageComponent(
            leftIcon,
            size: 18,
            boxFit: BoxFit.scaleDown,
          ),
          SizedBox(
            width: 15,
          ),
          Expanded(
            child: textField,
          ),
        ],
      ),
    );
  }
}
